import * as React from "react";
import Styled from "./styles.scss";
interface IBlockProps {
    [x: string]: any;
    status: number;
}

interface IBlockStates {
    [x: string]: any;
}

class Block extends React.Component<IBlockProps, IBlockStates> {
    private StyleStatus = [
        Styled.block,
        Styled.block + " " + Styled.fill,
        Styled.block + " " + Styled.hit
    ];
    constructor(props: IBlockProps) {
        super(props);
    }

    public shouldComponentUpdate(nextProps: IBlockProps, nextState: IBlockStates) {
        return this.props.status !== nextProps.status;
    }

    public render() {
        return (
            <span className={this.StyleStatus[this.props.status]} />
        );
    }
}
export default Block;
